﻿using EntGuayasSLA.BL;
using Ext.Net;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace EGuayas.Web.Auditoria.Promo.Monitoreo
{
    public partial class pgMonitoreo : pgBase
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (!X.IsAjaxRequest)
                {
                    var id = Request["mon_id"];
                    Session[SessionPage.PageGestionPromoAudMon + Constantes.AMonitoreo] = id;
                    var ExpedienteId = Request["exp_id"];
                    Session[SessionPage.PageGestionPromoAudMon + Constantes.Expediente] = ExpedienteId;
                    Session[SessionPage.PageGestionPromoAudMon + "codFase_" + Constantes.AMonitoreo] = Constantes.AMonitoreo;//revisar si PageGestionAdminAudMon o PageGestionPromoAudMon
                    Session[SessionPage.PageGestionPromoAudMon + "FASE_ID_" + Constantes.AMonitoreo] = id;
                    Session[SessionPage.PageGestionPromoAudMon + "_estadoFase" + Constantes.AMonitoreo] = Request["estado"];
                }
            }
            catch (Exception ex)
            {
                RegistrarLog(ex);
            }
        }
        #region Documentos Promotor

        /// <summary>
        /// Inicializar constante de Borrardor
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void OnLoadDocMonAdded(object sender, ComponentAddedEventArgs e)
        {
            try
            {
            Ext.Net.Panel panel = (Ext.Net.Panel)e.Control;
            SetCustomConfigWucAllAud(panel, Constantes.AMonitoreo, Valores.Modulo_Archivo_Aud_Moni, SessionPage.PageGestionPromoAudMon, Request["mon_id"], Request["exp_id"], Request["exa_id"]);
            }
            catch (Exception ex)
            {
                RegistrarLog(ex);
            }
            
        }
        protected void OnInformeAdded(object sender, ComponentAddedEventArgs e)
        {
            try
            {
                Ext.Net.Panel panel = (Ext.Net.Panel)e.Control;
                SetCustomConfigWucAllAud(panel, Constantes.AMonitoreo, Valores.Modulo_Archivo_Informes_Aud_Moni, SessionPage.PageGestionPromoAudMon, Request["mon_id"], Request["exp_id"], Request["exa_id"]);
            }
            catch (Exception ex)
            {
                RegistrarLog(ex);
            }
        }
        #endregion

    }
}